package com.itheima.tcp.demo2;

import java.io.*;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        Socket s=new Socket("127.0.0.1",10000);
        OutputStream outputStream = s.getOutputStream();
        outputStream.write("hello".getBytes());
        s.shutdownOutput();
        InputStream inputStream = s.getInputStream();
        BufferedReader br=new BufferedReader(new InputStreamReader(inputStream));
        String line;
        while((line=br.readLine())!=null){
            System.out.println(line);
        }
        s.close();

    }
}
